<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var computer = {
            color: 'white',
            weight: '2kg',
            brand: 'apple',
            model: 'MacBook Pro',
            watchMovie: function () {
                console.log('正在看电影');
            },
            listenMusic: function () {
                console.log('正在听音乐');
            },
            playGames: function () {
                console.log('正在打游戏');
            },
            knockCode: function () {
                console.log('正在敲代码');
            }
        }
        for (var k in computer) {
            console.log(k);
            console.log(computer[k]);
        }
    </script>
</head>

<body>

</body>

</html>